using System;

namespace System.IO
{
	/// <summary>
	/// Defines functionality for an object that provides inline processing for data.
	/// </summary>
	/// <remarks>Deriving classes typically raise events to indicate significance of special data
	/// that has been encountered and captured. Useful for processing something like, say,
	/// telnet data.</remarks>
	public interface IDataProcessor : IDisposable
	{
		/// <summary>
		/// Initializes the IDataProcessor with the two ByteQueue's it needs - one for its input,
		/// the other for its output.
		/// </summary>
		/// <param name="inputQueue">The ByteQueue that has unparsed/unprocessed input data for the IDataProcessor.
		/// If null, the IDataProcessor is expected to create its own.</param>
		/// <param name="outputQueue">The ByteQueue that will contain parsed/processed output data for the IDataProcessor.
		/// If null, the IDataProcessor is expected to create its own.</param>
		void Initialize(System.Collections.IQueue<byte> inputQueue, System.Collections.IQueue<byte> outputQueue);

		/// <summary>
		/// Commands the IDataProcessor to process as much waiting data as possible.
		/// </summary>
		void Pulse();

		/// <summary>
		/// Gets the ByteQueue that the IDataProcessor is using to hold input data
		/// </summary>
		System.Collections.IQueue<byte> InputQueue {get;}

		/// <summary>
		/// Gets the ByteQueue that the IDataProcessor is using to hold output data
		/// </summary>
		System.Collections.IQueue<byte> OutputQueue {get;}
	}
}
